]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
worldClocks: Ignore locations with unknown timezone
authorFlorian Müllner <fmuellner@gnome.org>
Sun, 28 Apr 2019 10:33:41 +0000 (12:33 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Tue, 30 Apr 2019 16:15:27 +0000 (16:15 +0000)
We currently assume that every location has an associated timezone.
While this is sound in the real world, in practise it depends on
whether or not libgweather can find a corresponding timezone DB
entry.

This used to be a fringe case, but has become more likely when commit
https://gitlab.gnome.org/GNOME/libgweather/commit/d7682676ac9 moved
weather stations from cities to countries - the station itself is un-
likely to have a timezone entry, and the country may be part of more
than a single timezone.

It would be good for libgweather to return a timezone for those
locations again, but we should defend against the case anyway.
We cannot tell what time it is at a particular location without
knowing the timezone, so simply filter them out.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1062

js/ui/dateMenu.js

index cf66cc1c2a69f0cb340cfcbddd8a7a8b3c8f9472..4e8ce7d24271228290341957b6754c33853a94cb 100644 (file)
@@ -118,7 +118,7 @@ var WorldClocksSection = class WorldClocksSection {
             if (!clocks[i].location)
                 continue;
             let l = world.deserialize(clocks[i].location);
-            if (l)
+            if (l && l.get_timezone() != null)
                 this._locations.push({ location: l });
         }